function getWithLoading(p1,p2,p3,p4){
    var url;
    var params;
    var successback;
    var errorback;
    if(typeof p1 == "string"){
        url = p1;
    }else{
        return "URL参数不能为空";
    }

    if(typeof p2 == "function"){
        successback = p2;
        errorback = p3;
    }else{
        params = p2;
        successback = p3;
        errorback = p4;
    }

    if(typeof successback == "undefined"){
        successback =  function(json){};
    }else if(typeof successback != "function"){
        return "SuccessBack参数错误,类型应为function";
    }

    if(typeof errorback == "undefined"){
        errorback =  function(json){};
    }else if(typeof errorback != "function"){
        return "ErrorBack参数错误,类型应为function";
    }

    var index = layer.load(2);
    $.ajax({
            url: url,
            dataType: 'json',
            data: params,
            success: function(json){
                if(typeof json == "string"){
                    json = parseJSON(json);
                }
                if(json.retCode == "SUCCESS" ){
                    successback(json)
                }else{
                    layer.alert("服务器错误!");
                    errorback(json);
                }
            },
            error: function(){
                layer.alert("服务器错误!");
                errorback();
            }
        })
        .always(function() {
            layer.close(index);
        });
}